package com.jiangjiang.eshop.membership.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jiangjiang.eshop.membership.dto.MemberLevelDetailDTO;
import com.jiangjiang.eshop.membership.dto.MemberLevelDetailPageDTO;
import com.jiangjiang.eshop.membership.service.MemberLevelDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName MemberLevelDetailController
 * @Description TODO
 * @Author jhw
 * @Date 2021/8/22 16:38
 * @Version 1.0
 **/
@Slf4j
@RestController
@RequestMapping("/member/level")
public class MemberLevelDetailController {

    @Autowired
    private MemberLevelDetailService memberLevelDetailService;

    /**
     * 分页查询用户等级变更明细数据
     * @param dto 查询条件
     * @return 查询结果
     */
    @PostMapping("/queryForPage")
    public Page<MemberLevelDetailDTO> queryForPage(@RequestBody MemberLevelDetailPageDTO dto){
        try {
            return memberLevelDetailService.queryForPage(dto);
        }catch (Exception e){
            log.warn("MemberLevelDetailController queryForPage error",e);
        }
        return null;
    }

}
